using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Xml;

using Gtk;
using Mono.Cecil;
using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
using MonoDevelop.Core.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Projects.CodeGeneration;
using MonoDevelop.Projects.Parser;
using MonoDevelop.Projects.Text;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Pads;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Tasks;


namespace MonoDevelop.SmokeyAddin
{
        public enum Commands {
                InspectWithSmokey
        }       

        internal class InspectWithSmokeyHandler: CommandHandler {
                protected override void Run ()
                {
                        if (IdeApp.ProjectOperations.CurrentOpenCombine != null) {
                                if (IdeApp.ProjectOperations.CurrentSelectedCombineEntry != null)
                                        Inspector.BeginInspecting (IdeApp.ProjectOperations.CurrentSelectedCombineEntry);
                        }
                }

                protected override void Update (CommandInfo info)
                {
                        bool enabled = false;
                        bool visible = false;
                        CombineEntry entry = IdeApp.ProjectOperations.CurrentSelectedCombineEntry;
                        if (entry != null) {
                                enabled = !(Inspector.IsInspecting);
                                visible = Inspector.IsInspectable (entry);
                                info.Text = GettextCatalog.GetString ("Inspect {0} with Smokey", entry.Name);
                        } else {
                                enabled = false;
                                visible = false;
                        }
                        info.Enabled = enabled;
                        info.Visible = visible;
                }        
        }
}
